#ifndef FILEREQUEST_H
#define FILEREQUEST_H

#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QObject>
#include <QJsonObject>

class FileRequest : public QObject
{
    Q_OBJECT
public:
    explicit FileRequest(QObject *parent = nullptr);

    void uploadFile(const QByteArray  &data);

    void getFile(const QString &avatar_url);

    QString getUri(const QString &url);

signals:
    void uploadFinished(QJsonObject obj);

    void getFinished(QByteArray obj);

private slots:
    void onFinished(QNetworkReply *);

private:
    QNetworkAccessManager *manager = nullptr;

    QString ip = "8.130.86.186";
};

#endif // FILEREQUEST_H
